package com.qf.entity;


import org.springframework.util.ObjectUtils;

public class TNotify implements CheckNull{

  private Long id;
  private String tag;
  private String desp;
  private Long notifyState;
  private Long cacheState;

  @Override
  public boolean isNull(CheckType type) {
    switch (type){
      case ADD:
        return ObjectUtils.isEmpty(tag)||ObjectUtils.isEmpty(desp)||ObjectUtils.isEmpty(notifyState)||ObjectUtils.isEmpty(cacheState);
      case UPDATE:
        return ObjectUtils.isEmpty(id)||ObjectUtils.isEmpty(tag)||ObjectUtils.isEmpty(desp)||ObjectUtils.isEmpty(notifyState)||ObjectUtils.isEmpty(cacheState);
      case DELETE:
        return ObjectUtils.isEmpty(id);
    }
    return false;
  }

  @Override
  public String toString() {
    return "TNotify{" +
            "id=" + id +
            ", tag='" + tag + '\'' +
            ", desp='" + desp + '\'' +
            ", notifyState=" + notifyState +
            ", cacheState=" + cacheState +
            '}';
  }

  public Long getId() {
    return id;
  }

  public void setId(Long id) {
    this.id = id;
  }


  public String getTag() {
    return tag;
  }

  public void setTag(String tag) {
    this.tag = tag;
  }


  public String getDesp() {
    return desp;
  }

  public void setDesp(String desp) {
    this.desp = desp;
  }


  public Long getNotifyState() {
    return notifyState;
  }

  public void setNotifyState(Long notifyState) {
    this.notifyState = notifyState;
  }


  public Long getCacheState() {
    return cacheState;
  }

  public void setCacheState(Long cacheState) {
    this.cacheState = cacheState;
  }

}
